﻿<!DOCTYPE html>
<html>
<head>
    <title>API测试</title>
</head>
<body>
    <h1>采购供应商API测试</h1>
    <button onclick="testAPI()">测试API</button>
    <div id="result"></div>

    <script>
        async function testAPI() {
            try {
                const response = await fetch("/api/purchase/supplier/page", {
                    method: "POST",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    body: JSON.stringify({
                        pageNum: 1,
                        pageSize: 10
                    })
                });
                
                const data = await response.json();
                document.getElementById("result").innerHTML = "<pre>" + JSON.stringify(data, null, 2) + "</pre>";
            } catch (error) {
                document.getElementById("result").innerHTML = "错误: " + error.message;
            }
        }
    </script>
</body>
</html>
